package org.sipsl.gisystems.gentest.gui;


import org.zkoss.zk.ui.Session;
import org.zkoss.zk.ui.Sessions;

public class UserCredentialManager {
    
	private static final String KEY_USER_MODEL = UserCredentialManager.class.getName()+"_MODEL";
    private UserDAO userDAO;
    private User user;
     
    private UserCredentialManager(){
        userDAO = new UserDAO();
    }
    
//    public User getUser(String _login){
//    	
//    	//
//    	return 
//    	
//    	//access Calendar data
//    }
     
    public static UserCredentialManager getIntance(){
        return getIntance(Sessions.getCurrent());
    }
     
    public static UserCredentialManager getIntance(Session zkSession) {
 
        synchronized(zkSession){
            UserCredentialManager userModel = (UserCredentialManager) zkSession.getAttribute(KEY_USER_MODEL);
            if(userModel==null){
                zkSession.setAttribute(KEY_USER_MODEL, userModel = new UserCredentialManager());
            }
            return userModel;
        }
    }

}
